﻿using System;
using System.Collections.Generic;

using System.Text;

namespace TimKen.DataEntity
{
    /// <summary>
    /// 产品实体类
    /// </summary>
    public class Product
    {
        public Product()
        { }
        #region Model
        private int _productid;
        private string _itemcode;
        private string _itemclass;
        private int? _typeid;
        private decimal _invqty;
        private decimal? _bookedqty;
        private string _image;
        private string _currency;
        private decimal _basicprice;
        private bool _ispromote;
        private decimal? _promoteDiscount;
        private decimal? _promoteqty;
        private int _taxclassid;
        private decimal? _taxrate;
        private int? _brandid;
        private string _baseunit;
        private string _salesunit;
        private bool _vaild;
        private DateTime? _validfrom;
        private DateTime? _vailto;
        private DateTime _dateadded;
        private DateTime? _lastmodified;
        private int _ordered;
        private bool _freeze;
        private DateTime? _freezefrom;
        private DateTime? _freezeto;

        private bool _isDisplay = true;

        /// <summary>
        /// 
        /// </summary>
        public int ProductID
        {
            set { _productid = value; }
            get { return _productid; }
        }
        /// <summary>
        /// 产品唯一性编号，来源于ERP
        /// </summary>
        public string ItemCode
        {
            set { _itemcode = value; }
            get { return _itemcode; }
        }
        /// <summary>
        /// 产品类别，来源于ERP，暂时不使用
        /// </summary>
        public string ItemClass
        {
            set { _itemclass = value; }
            get { return _itemclass; }
        }
        /// <summary>
        /// 产品类型编号，决定产品会有哪些属性
        /// </summary>
        public int? CategoryID
        {
            set { _typeid = value; }
            get { return _typeid; }
        }
        /// <summary>
        /// 产品库存数量，从ERP同步过来
        /// </summary>
        public decimal InvQty
        {
            set { _invqty = value; }
            get { return _invqty; }
        }
        /// <summary>
        /// 锁库存量：在EC已确认未发货部分，当订单发货时需要释放
        /// </summary>
        public decimal? BookedQty
        {
            set { _bookedqty = value; }
            get { return _bookedqty; }
        }
        public string Image
        {
            get { return _image; }
            set { _image = value; }
        }
     
        /// <summary>
        /// 价格币种
        /// </summary>
        public string Currency
        {
            set { _currency = value; }
            get { return _currency; }
        }
        /// <summary>
        /// 产品价格
        /// </summary>
        public decimal BasicPrice
        {
            set { _basicprice = value; }
            get { return _basicprice; }
        }
        /// <summary>
        /// 是否促销
        /// </summary>
        public bool IsPromote
        {
            set { _ispromote = value; }
            get { return _ispromote; }
        }
        /// <summary>
        /// 促销价
        /// </summary>
        public decimal? PromoteDiscount
        {
            set { _promoteDiscount = value; }
            get { return _promoteDiscount; }
        }
        /// <summary>
        /// 促销数量
        /// </summary>
        public decimal? PromoteQty
        {
            set { _promoteqty = value; }
            get { return _promoteqty; }
        }
        /// <summary>
        /// 税收类别
        /// </summary>
        public int TaxClassID
        {
            set { _taxclassid = value; }
            get { return _taxclassid; }
        }
        /// <summary>
        /// 税率
        /// </summary>
        public decimal? TaxRate
        {
            set { _taxrate = value; }
            get { return _taxrate; }
        }
        /// <summary>
        /// 产品品牌
        /// </summary>
        public int? BrandID
        {
            set { _brandid = value; }
            get { return _brandid; }
        }
        /// <summary>
        /// 产品基本单位，一般指库存单位
        /// </summary>
        public string BaseUnit
        {
            set { _baseunit = value; }
            get { return _baseunit; }
        }
        /// <summary>
        /// 销售单位，来源于ERP
        /// </summary>
        public string SalesUnit
        {
            set { _salesunit = value; }
            get { return _salesunit; }
        }
        /// <summary>
        /// 产品是否有效
        /// </summary>
        public bool Vaild
        {
            set { _vaild = value; }
            get { return _vaild; }
        }
        /// <summary>
        /// 生效日期
        /// </summary>
        public DateTime? ValidFrom
        {
            set { _validfrom = value; }
            get { return _validfrom; }
        }
        /// <summary>
        /// 失效日期
        /// </summary>
        public DateTime? VailTo
        {
            set { _vailto = value; }
            get { return _vailto; }
        }
        /// <summary>
        /// 添加时间
        /// </summary>
        public DateTime DateAdded
        {
            set { _dateadded = value; }
            get { return _dateadded; }
        }
        /// <summary>
        /// 最终修改时间
        /// </summary>
        public DateTime? LastModified
        {
            set { _lastmodified = value; }
            get { return _lastmodified; }
        }
        /// <summary>
        /// 排序 ，暂时不使用，保留
        /// </summary>
        public int Ordered
        {
            set { _ordered = value; }
            get { return _ordered; }
        }



        public decimal Weight
        {
            get;
            set;
        }


        /// <summary>
        /// 促销开始时间
        /// </summary>
        public DateTime? PromoteFrom
        {
            set;
            get;
        }

        /// <summary>
        /// 促销结束时间
        /// </summary>
        public DateTime? PromoteTo
        {
            set;
            get;
        }
        /// <summary>
        /// 技术文件名
        /// </summary>

        public string IntroDocFiles {
            set;
            get;
        }


        /// <summary>
        /// ShipDays备货时效
        /// </summary>

        public int ShipDays
        {
            set;
            get;
        }

        public int ProductLineID { get; set; }
        public int DiscountGroupID { get; set; }


        public string WeightUnit { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public bool Freeze
        {
            set { _freeze = value; }
            get { return _freeze; }
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? FreezeFrom
        {
            set { _freezefrom = value; }
            get { return _freezefrom; }
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? FreezeTo
        {
            set { _freezeto = value; }
            get { return _freezeto; }
        }


        public  bool  IsDisplay
        {
            get
            {
                return _isDisplay;
            }
            set
            {
                _isDisplay = value;
            }
        }

        /// <summary>
        /// 最小数量
        /// </summary>
        public int MinNumber
        {
            get;
            set;
        }

        /// <summary>
        /// 最小倍数
        /// </summary>
        public int MinMultiple 
        {
            get;
            set;
        }


        public bool IsRecommend
        {
            get;
            set; 
        } 

        #endregion Model

    }



    //产品价格
    public class PPrice
    {
        public string ItemCode { get; set; }
        public string Currency { get; set; }
        public decimal Price { get; set; }
        public int PriceList { get; set; }
    }
}